fix(scheduler): default Configuration.participants to empty list#316
Merged
googsvg merged 4 commits intonylas:mainfrom May 1, 2026
Merged
Conversation
The Nylas Scheduler API does not include the 'participants' field on
group-event configurations, but Configuration.participants was a
non-nullable, no-default property. moshi-kotlin therefore raised:
com.squareup.moshi.JsonDataException:
Required value 'participants' missing at $.data[1]
whenever scheduler().configurations().list() returned a list
containing a group-event configuration, breaking the entire response.
Give the property a default value of emptyList() so moshi-kotlin
applies the default when the field is absent from the response. The
property's runtime type is unchanged (still
List<ConfigurationParticipant>), so existing callers — including the
'config.participants.first()' pattern in ConfigurationsTest — keep
compiling without modification.
Closes nylas#310.
Signed-off-by: SAY-5 <say.apm35@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #316 +/- ##
=========================================
Coverage 82.47% 82.47%
Complexity 357 357
=========================================
Files 37 37
Lines 1027 1027
Branches 95 95
=========================================
Hits 847 847
Misses 121 121
Partials 59 59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
@SAY-5 thanks for solving the issue, sorry I've missed the report of that issue. it just went under the radar we at Nylas really appreciate the community involvement, and we're grateful for your contribution ❤️ the fix will be deployed with next SDK release, soon :) |
This comment was marked as spam.
This comment was marked as spam.
googsvg
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #310.
scheduler().configurations().list(grantId)blew up withwhenever the response contained a group-event configuration, because the Nylas API omits
participantsfor group events butConfiguration.participantswas a non-nullable, no-default property inmodels/Scheduler.kt. moshi-kotlin therefore failed the entire page rather than just that entry.Fix
Default
Configuration.participantstoemptyList(). moshi-kotlin honours Kotlin data-class defaults when a field is absent from the JSON, so the field deserializes successfully on group-event configurations and keeps the same value as before on regular configurations.The property's runtime type is unchanged (
List<ConfigurationParticipant>), so existing call sites — includingconfig.participants.first()inConfigurationsTest.kt— keep compiling without modification, and no behaviour changes for callers that already hadparticipantspopulated.Test plan
config.participants.first()etc. still compile against the new declaration../gradlew testlocally — the project pinsJavaLanguageVersion=8via Gradle toolchain auto-detection and only JDK 11 is available in this environment. CI should cover this.scheduler().configurations().list(grantId)no longer throws when the response includes a group-event configuration.Note
Low Risk
Low risk: a small model deserialization tweak to tolerate missing
participants, plus a unit test, with no auth/security/data mutation changes.Overview
Fixes scheduler configuration deserialization when the API omits
participants(e.g., group-event configs) by defaultingConfiguration.participantstoemptyList()instead of treating it as required.Adds a regression test asserting missing
participantsdeserializes to an empty list, and updates local Claude permissions to allowgh pr/gh issuecommands.Reviewed by Cursor Bugbot for commit e42ac0b. Bugbot is set up for automated code reviews on this repo. Configure here.